package cn.jdx.controller;

import cn.jdx.listener.MyListener;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;


@RestController
public class MyController { //(5).编写控制器，每次访问的时候本地浏览器会多出来一个session
    @RequestMapping("/online")
    public String getlis(HttpSession session){
        session.setAttribute("key","value");
        return "当前的在线人数:"+ MyListener.online;
    }
}
